Release/4.0.1 - #362
Conversation
NM based connectivity check and Bug fixes
There was a problem hiding this comment.
Pull Request Overview
This PR releases version 4.0.1 with improvements to network connectivity management and reboot information handling.
- Replaces
network-online.targetwithnetwork-up.targetacross upload service files - Introduces a new connectivity check script that polls for HTTP 204 responses
- Updates warehouse reset to clean NetworkManager directories
- Reorders reboot information parameters for consistency
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| systemd_units/notify-network-ready.service | Removes obsolete connectivity check service |
| systemd_units/minidump-upload.service | Updates network dependency target |
| systemd_units/minidump-secure-upload.service | Updates network dependency target |
| systemd_units/coredump-upload.service | Updates network dependency target |
| systemd_units/coredump-secure-upload.service | Updates network dependency target |
| lib/rdk/warehouse-reset.sh | Adds cleanup of NetworkManager directories |
| lib/rdk/update_previous_reboot_info.sh | Reorders parameters in reboot log format |
| lib/rdk/connectivitycheck.sh | New script to poll URL for connectivity verification |
| lib/rdk/NM_Dispatcher.sh | Integrates connectivity check on interface up |
| CHANGELOG.md | Documents version 4.0.1 release notes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$URL") | ||
|
|
||
| if [ "$HTTP_CODE" -eq 204 ]; then |
There was a problem hiding this comment.
The -eq operator requires numeric operands, but if curl fails or returns an error, $HTTP_CODE may be empty or non-numeric, causing a test error. Add a check to ensure HTTP_CODE is numeric before comparison, or use a default value: if [ \"${HTTP_CODE:-0}\" -eq 204 ]; then
| if [ "$HTTP_CODE" -eq 204 ]; then | |
| if [ "${HTTP_CODE:-0}" -eq 204 ]; then |
| if [ ! -f $CONNCHECK_FILE ]; then | ||
| touch $CONNCHECK_FILE | ||
| fi |
There was a problem hiding this comment.
This file existence check and touch pattern is repeated three times (lines 42-44, 58-60, 69-71). Consider extracting this into a helper function to reduce duplication and improve maintainability.
| if [ -d /opt/NetworkManager ];then rm -rf /opt/NetworkManager ; fi | ||
| if [ -d /opt/secure/NetworkManager ];then rm -rf /opt/secure/NetworkManager ; fi |
There was a problem hiding this comment.
Lines 106-107 remove entire NetworkManager directories, which makes line 95's removal of /opt/NetworkManager/system-connections/* redundant. Since the parent directory is being removed, the earlier cleanup of the subdirectory is unnecessary. Consider removing line 95 or documenting why both are needed.
No description provided.